import request from '@/utils/request/req';

/**
 * 自动打招呼配置接口
 */

// 获取自动打招呼数据
export const getAutoGreetList = (params: { wechatAccountId?: string }) => {
  return request({
    url: '/msg/accountConfiguration/list',
    method: 'get',
    params
  });
};

// 新增自动打招呼配置
export const addAutoGreetConfig = (data: {
  wechatAccountId: string;
  automaticFriendAcceptance: number;
  automaticLikes: number;
  automaticGreetings: number;
  messageData?: any[];
}) => {
  return request({
    url: '/msg/addAccountConfiguration',
    method: 'post',
    data
  });
};

// 更新自动打招呼配置
export const updateAutoGreetConfig = (data: {
  id: number;
  wechatAccountId: string;
  automaticFriendAcceptance: number;
  automaticLikes: number;
  automaticGreetings: number;
  messageData?: any[];
}) => {
  return request({
    url: '/msg/updateAccountConfiguration',
    method: 'post',
    data
  });
};
